package com.crm.system.mapper;

import com.crm.entity.RoleMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface SysRoleMenuMapper {
    @Delete("DELETE FROM crm_role_menu\n" +
            "WHERE role_id='RoleId';")
    int Delete(String RoleId);

    @Insert("INSERT INTO crm_role_menu\n" +
            "(menu_id, role_id, create_time)\n" +
            "VALUES('#{MenuId}', '#{RoleId}', '#{CreateTime}');")
    int Insert(RoleMenu roleMenu);

    @Select("SELECT * FROM crm_role_menu")
    List<RoleMenu> list();
}
